﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace _20200302lianxi
{
    public partial class index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.TextBox1.Text=="")
            {
                Response.Write("<script>alert('请输入搜索内容')</script>");
            }
            else
            {
                //Response.Write("<script>window.location.assign('www.baidu.com/s?ie=utf-8&wd="+this.TextBox1.Text+"')</script>");
                Response.Redirect("https://www.baidu.com/s?ie=utf-8&wd="+this.TextBox1.Text);
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            if (this.TextBox1.Text == "")
            {
                Response.Write("<script>alert('请输入搜索内容')</script>");
            }
            else
            {
                //Response.Write("<script>window.location.assign('www.baidu.com/s?ie=utf-8&wd="+this.TextBox1.Text+"')</script>");
                Response.Redirect("https://www.sogou.com/web?query=" + this.TextBox1.Text);
            }
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            if (this.TextBox1.Text == "")
            {
                Response.Write("<script>alert('请输入搜索内容')</script>");
            }
            else
            {
                //Response.Write("<script>window.location.assign('www.baidu.com/s?ie=utf-8&wd="+this.TextBox1.Text+"')</script>");
                Response.Redirect("https://www.so.com/s?ie=utf-8&q=" + this.TextBox1.Text);
            }
        }
    }
}